<template>
  <div>
    <h2>上传游戏图片</h2>
    <el-upload
      class="upload-demo"
      action="#"
      ref="upload"
      multiple
      list-type="picture-card"
      :on-remove="handleRemove"
      :file-list="fileList"
      :auto-upload="false">
      <i slot="default" class="el-icon-plus"></i>
      <div slot="file" slot-scope="{file}">
        <img
          class="el-upload-list__item-thumbnail"
          :src="file.url" alt="">
<!--        <span class="el-upload-list__item-actions">
        <span
          class="el-upload-list__item-preview"
          @click="handlePictureCardPreview(file)"
        >
          <i class="el-icon-zoom-in"></i>
        </span>
        <span
          v-if="!disabled"
          class="el-upload-list__item-delete"
          @click="handleDownload(file)"
        >
          <i class="el-icon-download"></i>
        </span>
        <span
          v-if="!disabled"
          class="el-upload-list__item-delete"
          @click="handleRemove(file)"
        >
          <i class="el-icon-delete"></i>
        </span>
      </span>-->
      </div>
    </el-upload>
    <el-dialog :visible.sync="dialogVisible">
      <img width="100%" :src="dialogImageUrl" alt="">
    </el-dialog>
    <el-button size="small" type="primary" @click="submitUpload">点击上传</el-button>



    <h2>上传游戏视频</h2>
  ---------------------------------
  <el-input v-model="input" placeholder="请输入内容"></el-input>
  <el-button @click='twos'>写完了</el-button>
</div>
</template>

<script>



export default {
  name: "Two",
  data(){
    return{
      input : '',
      dialogImageUrl: '',
      dialogVisible: false,
      disabled: false,
      fileList: [],
    }
  },
  methods: {
    twos() {
      this.$emit("oneData2", this.input)
    },
    handleRemove(file) {
      console.log(file);

    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleDownload(file) {
      console.log(file);
    },
    submitUpload() {
      this.$refs.upload.submit();
    },
  },
}

</script>

<style scoped>

</style>
